package com.wangjie.pattern.strategy;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class BillStrategyFactory {
    private static final Map<String, BillStrategy> STRATEGY_MAP = new ConcurrentHashMap<>();

    public static BillStrategy getBillStrategy(String type) {
        return STRATEGY_MAP.get(type);
    }

    public static void register(String type, BillStrategy billStrategy) {
        STRATEGY_MAP.put(type, billStrategy);
    }
}